//
//  PayView4.m
//  yonghu
//
//  Created by 浪尖渝力 on 2018/2/6.
//  Copyright © 2018年 com.DJS. All rights reserved.
//

#import "PayView4.h"
#import <AlipaySDK/AlipaySDK.h>
#import "WXApi.h"
#import "OKViewController.h"
@implementation PayView4

-(void)creatView{
    [ZQTools cleanViewSubviews:self];
    
    self.backgroundColor=_LightGrey;
    
    UIView *topView=[UIView new];
    [self addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(5);
        make.right.mas_equalTo(-5);
        make.top.mas_equalTo(74);
        make.height.mas_equalTo(170);
    }];
    topView.backgroundColor=[UIColor whiteColor];
    topView.layer.cornerRadius=3;
    
    UIImageView *image=[UIImageView new];
    [topView addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(20);
        make.top.mas_equalTo(15);
    }];
    image.image=[UIImage imageNamed:@"金额"];
    
    UILabel *label=[UILabel new];
    [topView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(image.mas_right).mas_equalTo(10);
        make.centerY.mas_equalTo(image);
    }];
    label.text=@"咨询金额";
    label.textColor=ColorWithRGB(49, 49, 49);
    label.font=[UIFont systemFontOfSize:15];
    
    NSArray *arr=[NSArray arrayWithObjects:@"5元",@"10元",@"20元",@"30元",@"40元",@"50元",@"100元",@"自定义金额", nil];
    
    for (int i=0; i<5; i++) {
        UIView *xianView=[UIView new];
        [topView addSubview:xianView];
        [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10+(_mainW-30)/4*i);
            make.width.mas_equalTo(1);
            make.height.mas_equalTo(91);
            make.top.mas_equalTo(50);
        }];
        xianView.backgroundColor=_LightGrey;
    }
    for (int i=0; i<3; i++) {
        UIView *xianView=[UIView new];
        [topView addSubview:xianView];
        [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.right.mas_equalTo(-10);
            make.height.mas_equalTo(1);
            make.top.mas_equalTo(50+46*i);
        }];
        xianView.backgroundColor=_LightGrey;
    }
    int index2=0;
    for (int i=0; i<2; i++) {
        for (int j=0; j<4; j++) {
            UIButton *btn=[UIButton new];
            [topView addSubview:btn];
            [btn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(11+(_mainW-30)/4*j);
                make.width.mas_equalTo((_mainW-34)/4);
                make.top.mas_equalTo(46*i+50);
                make.height.mas_equalTo(45);
            }];
            btn.tag=index2;
            [btn setTitle:arr[index2] forState:0];
            if (index2==_index) {
                [btn setTitleColor:[UIColor whiteColor] forState:0];
                btn.backgroundColor=_backgroundColor;
            }
            else{
                [btn setTitleColor:ColorWithRGB(149, 149, 149) forState:0];
                btn.backgroundColor=[UIColor clearColor];
            }
            [btn addTarget:self action:@selector(selectMoney:) forControlEvents:UIControlEventTouchUpInside];
            index2+=1;
        }
    }
    
    
    
    
    UIView *payView=[UIView new];
    [self addSubview:payView];
    [payView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(15);
        make.left.right.mas_equalTo(topView);
        make.height.mas_equalTo(140);
    }];
    payView.backgroundColor=[UIColor whiteColor];
    payView.layer.cornerRadius=4;
    
    UIImageView *ZFBimageView=[UIImageView new];
    [payView addSubview:ZFBimageView];
    [ZFBimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(20);
        make.width.height.mas_equalTo(40);
    }];
    ZFBimageView.image=[UIImage imageNamed:@"支付宝支付"];
    
    UILabel *ZFBlabe=[UILabel new];
    [payView addSubview:ZFBlabe];
    [ZFBlabe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(ZFBimageView.mas_right).mas_equalTo(10);
        make.centerY.mas_equalTo(ZFBimageView);
    }];
    ZFBlabe.text=@"支付宝支付";
    ZFBlabe.font=[UIFont systemFontOfSize:15];
    ZFBlabe.textColor=ColorWithRGB(149, 149, 149);
    
    
    _selectPay=1;
    _ZFBBtn=[UIImageView new];
    [payView addSubview:_ZFBBtn];
    [_ZFBBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-10);
        make.width.height.mas_equalTo(20);
        make.centerY.mas_equalTo(ZFBimageView);
    }];
    _ZFBBtn.image =[UIImage imageNamed:@"是"];

    
    UIImageView *WXimageView=[UIImageView new];
    [payView addSubview:WXimageView];
    [WXimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(ZFBimageView.mas_bottom).mas_equalTo(25);
        make.width.height.mas_equalTo(40);
    }];
    WXimageView.image=[UIImage imageNamed:@"微信好友"];
    
    UILabel *WXlabe=[UILabel new];
    [WXimageView addSubview:WXlabe];
    [WXlabe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(WXimageView.mas_right).mas_equalTo(10);
        make.centerY.mas_equalTo(WXimageView);
    }];
    WXlabe.text=@"微信支付";
    WXlabe.font=[UIFont systemFontOfSize:15];
    WXlabe.textColor=ColorWithRGB(149, 149, 149);
    
    
    _WXBtn=[UIImageView new];
    [payView addSubview:_WXBtn];
    [_WXBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-10);
        make.width.height.mas_equalTo(20);
        make.centerY.mas_equalTo(WXimageView);
    }];

    _WXBtn.image=[UIImage imageNamed:@"否"];
    

    
    UIView *zhiFuBaoView=[UIView new];
    [payView addSubview:zhiFuBaoView];
    [zhiFuBaoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(70);
    }];
    zhiFuBaoView.tag=1;
    zhiFuBaoView.userInteractionEnabled=YES;
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectPay:)];
    [zhiFuBaoView addGestureRecognizer:tapGesture];
    
    
    UIView *weiXinView=[UIView new];
    [payView addSubview:weiXinView];
    [weiXinView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.height.mas_equalTo(70);
    }];
    weiXinView.tag=2;
    weiXinView.userInteractionEnabled=YES;
    UITapGestureRecognizer *tapGesture2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectPay:)];
    [weiXinView addGestureRecognizer:tapGesture2];
    
    UIButton *btn=[UIButton new];
    [self addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.height.mas_equalTo(50);
        make.bottom.mas_equalTo(-40);
    }];
    btn.backgroundColor=_backgroundColor;
    btn.layer.cornerRadius=15;
    [btn setTitle:@"确认支付" forState:0];
    [btn setTitleColor:[UIColor whiteColor] forState:0];
    [btn addTarget:self action:@selector(payBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *imaView=[UIImageView new];
    [self addSubview:imaView];
    [imaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(50);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(-20);
        make.height.mas_equalTo(55);
        make.width.mas_equalTo(30);
    }];
    imaView.image=[UIImage imageNamed:@"纽带"];
    
    UIImageView *imaView2=[UIImageView new];
    [self addSubview:imaView2];
    [imaView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-50);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(-20);
        make.height.mas_equalTo(55);
        make.width.mas_equalTo(30);
    }];
    imaView2.image=[UIImage imageNamed:@"纽带"];
}

-(IBAction)selectMoney:(UIButton *)btn{
    _index=(int)btn.tag;
    if (_index==7) {
        [self creatView2];
    }else{
        [self creatView];
    }
}
-(void)creatView2{
    [ZQTools cleanViewSubviews:self];
    
    self.backgroundColor=_LightGrey;
    
    UIView *topView=[UIView new];
    [self addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(5);
        make.right.mas_equalTo(-5);
        make.top.mas_equalTo(74);
        make.height.mas_equalTo(240);
    }];
    topView.backgroundColor=[UIColor whiteColor];
    topView.layer.cornerRadius=3;
    
    UIImageView *image=[UIImageView new];
    [topView addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(20);
        make.top.mas_equalTo(15);
    }];
    image.image=[UIImage imageNamed:@"金额"];
    
    UILabel *label=[UILabel new];
    [topView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(image.mas_right).mas_equalTo(10);
        make.centerY.mas_equalTo(image);
    }];
    label.text=@"咨询金额";
    label.textColor=ColorWithRGB(49, 49, 49);
    label.font=[UIFont systemFontOfSize:15];
    
    NSArray *arr=[NSArray arrayWithObjects:@"5元",@"10元",@"20元",@"30元",@"40元",@"50元",@"100元",@"自定义金额", nil];
    
    for (int i=0; i<5; i++) {
        UIView *xianView=[UIView new];
        [topView addSubview:xianView];
        [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10+(_mainW-30)/4*i);
            make.width.mas_equalTo(1);
            make.height.mas_equalTo(91);
            make.top.mas_equalTo(50);
        }];
        xianView.backgroundColor=_LightGrey;
    }
    for (int i=0; i<3; i++) {
        UIView *xianView=[UIView new];
        [topView addSubview:xianView];
        [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.right.mas_equalTo(-10);
            make.height.mas_equalTo(1);
            make.top.mas_equalTo(50+46*i);
        }];
        xianView.backgroundColor=_LightGrey;
    }
    int index2=0;
    for (int i=0; i<2; i++) {
        for (int j=0; j<4; j++) {
            UIButton *btn=[UIButton new];
            [topView addSubview:btn];
            [btn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(11+(_mainW-30)/4*j);
                make.width.mas_equalTo((_mainW-34)/4);
                make.top.mas_equalTo(46*i+50);
                make.height.mas_equalTo(45);
            }];
            btn.tag=index2;
            [btn setTitle:arr[index2] forState:0];
            if (index2==_index) {
                [btn setTitleColor:[UIColor whiteColor] forState:0];
                btn.backgroundColor=_backgroundColor;
            }
            else{
                [btn setTitleColor:ColorWithRGB(149, 149, 149) forState:0];
                btn.backgroundColor=[UIColor clearColor];
            }
            [btn addTarget:self action:@selector(selectMoney:) forControlEvents:UIControlEventTouchUpInside];
            index2+=1;
        }
    }
    
    
    UILabel *moneyLabel=[UILabel new];
    [topView addSubview:moneyLabel];
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(170);
        make.width.mas_equalTo(100);
    }];
    moneyLabel.text=@"输入金额:";
    moneyLabel.font=[UIFont systemFontOfSize:18];
    moneyLabel.textColor=ColorWithRGB(49, 49, 49);
    
    _moneyText=[UITextField new];
    [self addSubview:_moneyText];
    [_moneyText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(moneyLabel.mas_right).mas_equalTo(5);
        make.right.mas_equalTo(-10);
        make.centerY.mas_equalTo(moneyLabel);
        make.height.mas_equalTo(45);
    }];
    _moneyText.layer.cornerRadius=3;
    _moneyText.layer.borderWidth=1;
    _moneyText.layer.borderColor=_LightGrey.CGColor;
    _moneyText.textColor=ColorWithRGB(149, 149, 149);
    _moneyText.font=[UIFont systemFontOfSize:19];
    _moneyText.returnKeyType=UIReturnKeyDone;
    _moneyText.keyboardType=UIKeyboardTypePhonePad;
    _moneyText.delegate=self;
    
    
    UIImageView *imaView=[UIImageView new];
    [self addSubview:imaView];
    [imaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(50);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(-20);
        make.height.mas_equalTo(55);
        make.width.mas_equalTo(30);
    }];
    imaView.image=[UIImage imageNamed:@"纽带"];
    
    UIImageView *imaView2=[UIImageView new];
    [self addSubview:imaView2];
    [imaView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-50);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(-20);
        make.height.mas_equalTo(55);
        make.width.mas_equalTo(30);
    }];
    imaView2.image=[UIImage imageNamed:@"纽带"];
    
    
    UIView *payView=[UIView new];
    [self addSubview:payView];
    [payView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(15);
        make.left.right.mas_equalTo(topView);
        make.height.mas_equalTo(140);
    }];
    payView.backgroundColor=[UIColor whiteColor];
    payView.layer.cornerRadius=4;
    
    UIImageView *ZFBimageView=[UIImageView new];
    [payView addSubview:ZFBimageView];
    [ZFBimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(20);
        make.width.height.mas_equalTo(40);
    }];
    ZFBimageView.image=[UIImage imageNamed:@"支付宝支付"];
    
    UILabel *ZFBlabe=[UILabel new];
    [payView addSubview:ZFBlabe];
    [ZFBlabe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(ZFBimageView.mas_right).mas_equalTo(10);
        make.centerY.mas_equalTo(ZFBimageView);
    }];
    ZFBlabe.text=@"支付宝支付";
    ZFBlabe.font=[UIFont systemFontOfSize:15];
    ZFBlabe.textColor=ColorWithRGB(149, 149, 149);
    
    
    _selectPay=1;
    _ZFBBtn=[UIImageView new];
    [payView addSubview:_ZFBBtn];
    [_ZFBBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-10);
        make.width.height.mas_equalTo(20);
        make.centerY.mas_equalTo(ZFBimageView);
    }];
    _ZFBBtn.tag=1;
    _ZFBBtn.image =[UIImage imageNamed:@"是"];
    _ZFBBtn.userInteractionEnabled=YES;
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectPay:)];
    [_ZFBBtn addGestureRecognizer:tapGesture];
    
    UIImageView *WXimageView=[UIImageView new];
    [payView addSubview:WXimageView];
    [WXimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(ZFBimageView.mas_bottom).mas_equalTo(25);
        make.width.height.mas_equalTo(40);
    }];
    WXimageView.image=[UIImage imageNamed:@"微信好友"];
    
    UILabel *WXlabe=[UILabel new];
    [WXimageView addSubview:WXlabe];
    [WXlabe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(WXimageView.mas_right).mas_equalTo(10);
        make.centerY.mas_equalTo(WXimageView);
    }];
    WXlabe.text=@"微信支付";
    WXlabe.font=[UIFont systemFontOfSize:15];
    WXlabe.textColor=ColorWithRGB(149, 149, 149);
    
    
    _WXBtn=[UIImageView new];
    [payView addSubview:_WXBtn];
    [_WXBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-10);
        make.width.height.mas_equalTo(20);
        make.centerY.mas_equalTo(WXimageView);
    }];
    _WXBtn.tag=2;
    _WXBtn.image=[UIImage imageNamed:@"否"];
    
    _WXBtn.userInteractionEnabled=YES;
    UITapGestureRecognizer *tapGesture2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectPay:)];
    [_WXBtn addGestureRecognizer:tapGesture2];
    
    UIButton *btn=[UIButton new];
    [self addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.height.mas_equalTo(50);
        make.bottom.mas_equalTo(-40);
    }];
    btn.backgroundColor=_backgroundColor;
    btn.layer.cornerRadius=15;
    [btn setTitle:@"确认支付" forState:0];
    [btn setTitleColor:[UIColor whiteColor] forState:0];
    [btn addTarget:self action:@selector(payBtn:) forControlEvents:UIControlEventTouchUpInside];
}
-(IBAction)selectPay:(UITapGestureRecognizer *)tap{
    _selectPay=(int)tap.view.tag;
    if (_selectPay==1) {
        _ZFBBtn.image=[UIImage imageNamed:@"是"];
        _WXBtn.image=[UIImage imageNamed:@"否"];
    }
    else{
        _WXBtn.image=[UIImage imageNamed:@"是"];
        _ZFBBtn.image=[UIImage imageNamed:@"否"];
    }
}

-(IBAction)payBtn:(id)sender{
    NSDictionary *userDic = [NSKeyedUnarchiver unarchiveObjectWithFile:_userModelFile];
    NSString *token=[userDic objectForKey:@"token"];
    NSNumber *waiter_id1=[userDic objectForKey:@"user_id"];
    NSString *user_id=[NSString stringWithFormat:@"%@",waiter_id1];
    
    NSNumber *dt_id1=[_dic objectForKey:@"consult_id"];
    NSString *consult_id=[NSString stringWithFormat:@"%@",dt_id1];
 
    
    NSString *consult_money;
    if (_index==0) {
        consult_money=@"5";
    }
    if (_index==1) {
        consult_money=@"10";
    }
    if (_index==2) {
        consult_money=@"20";
    }
    if (_index==3) {
        consult_money=@"30";
    }if (_index==4) {
        consult_money=@"40";
    }
    if (_index==5) {
        consult_money=@"50";
    }
    if (_index==6) {
        consult_money=@"100";
    }if (_index==7) {
       consult_money=_moneyText.text;
    }
    if (consult_money.doubleValue==0) {
        [ZQTools svpInfo:@"金额必须大于0"];
        return;
    }
    
    NSDictionary *dic=[NSDictionary dictionaryWithObjectsAndKeys:token,@"token",@"0",@"user_role",user_id,@"user_id",consult_id,@"consult_id",[NSString stringWithFormat:@"%d",_selectPay],@"pay_type",consult_money,@"money", nil];
    
    [ZQTools AFNPostDataUrl:@"user/consult/listen_pay" Dict:dic andTableView:nil andViewController:self.viewController andSuccessBlock:^(id responseObject) {
        _litigation_id=[responseObject objectForKey:@"litigation_id"];
        if (_selectPay==1) {
            [self diaoZhiFuBao:[responseObject objectForKey:@"aliContent"]];
        }
        else{
            [self WeiXin:responseObject];
        }
        
    } anderrorBlock:nil  ];
    
}
-(void)diaoZhiFuBao:(NSString *)order{
  
    NSString *appScheme = @"DJSYHPaydemo";
    [[AlipaySDK defaultService] payOrder:order fromScheme:appScheme callback:^(NSDictionary *resultDic) {
        if ([resultDic[@"resultStatus"]intValue] == 9000) {
             [self pushTOOK];
        } else {
            [ZQTools svpInfo:@"支付失败"];
        }
    }];
}
-(void)WeiXin:(NSDictionary *)sender{
    NSUserDefaults *zhiFu = [NSUserDefaults standardUserDefaults];
    [zhiFu setObject:@"weinXin" forKey:@"ZhiFu"];
    PayReq *request = [[PayReq alloc] init];
    /** 商家向财付通申请的商家id */
    request.partnerId =[sender objectForKey:@"partnerid"];
    /** 预支付订单 */
    request.prepayId=[sender objectForKey:@"prepayid"];
    /** 商家根据财付通文档填写的数据和签名 */
    request.package =@"Sign=WXPay";
    /** 随机串，防重发 */
    request.nonceStr= [sender objectForKey:@"noncestr"];
    /** 时间戳，防重发 */
    request.timeStamp=[[sender objectForKey:@"timestamp"] intValue];
    /** 商家根据微信开放平台文档对数据做的签名 */
    request.sign= [sender objectForKey:@"sign"];
    /*! @brief 发送请求到微信，等待微信返回onResp
     *
     * 函数调用后，会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型
     * SendAuthReq、SendMessageToWXReq、PayReq等。
     * @param req 具体的发送请求，在调用函数后，请自己释放。
     * @return 成功返回YES，失败返回NO。
     */
    
    if ([WXApi sendReq: request]) {
        NSNotification * notice = [NSNotification notificationWithName:@"zhiFu" object:nil userInfo:nil];
        //发送消息
        [[NSNotificationCenter defaultCenter]postNotification:notice];

        NSNotificationCenter * center2 = [NSNotificationCenter defaultCenter];
        //添加当前类对象为一个观察者，name和object设置为nil，表示接收一切通知
        [center2 addObserver:self selector:@selector(networkDidReceiveMessage2:) name:@"zhiFu2" object:nil];

    }
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
-(void)networkDidReceiveMessage2:(NSNotification *)notification{
//    [self pushTOOK];
    [self.viewController.navigationController popViewControllerAnimated:YES];
    
}
-(void)pushTOOK{
    NSDictionary *dic=[NSDictionary dictionaryWithObjectsAndKeys:_litigation_id,@"litigation_id",@"发布案件",@"neixin", nil];
    OKViewController *okView=[[OKViewController alloc] init];
    okView.dic=dic;
    [ZQTools pushNextViewController:self.viewController andRootController:okView];
}


@end
